package com.shanjupay.operationapp.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
@RefreshScope
public class TestConfigController {

    @Value("${management.endpoints.web.exposure.include}")
    private String useLocalCache;

    @Autowired
    private Registration registration; // 服务注册

    @RequestMapping("/get")
    public String get() {
        return registration.getPort()+ " : " + useLocalCache + "<br/>" ;
    }

}
